Skip to content

fixed the paginition in student records #32

Merged
Pragya79645 merged 1 commit intoGDSC-RCCIIT:mainfrom
Sampurnasit:sampurnasit/student-record-paginition-fix
Apr 28, 2026
Merged

fixed the paginition in student records #32
Pragya79645 merged 1 commit intoGDSC-RCCIIT:mainfrom
Sampurnasit:sampurnasit/student-record-paginition-fix

Conversation

@Sampurnasit
Copy link
Copy Markdown
Contributor

Problem

Pagination behaved incorrectly when the student count was exactly 11.
totalPages had a hardcoded edge-case that subtracted 1 whenever
filtered.length === 11, causing one page to be lost.

Fix

Removed the hardcoded special case. totalPages is now always computed
correctly via Math.ceil(filtered.length / pageSize).

Result

With 11 students and pageSize 5, pagination now correctly shows 3 pages.

Fixes #23

Copy link
Copy Markdown
Collaborator

@Soyam27 Soyam27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@Pragya79645 Pragya79645 merged commit dc3e0e6 into GDSC-RCCIIT:main Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exactly 11 students breaks pagination (inside school building)

3 participants